package com.web.surf.sample.eshop.database.dao.interfaces;

import java.util.List;
import com.web.surf.sample.eshop.faces.core.AbstractBean;
import com.web.surf.sample.eshop.faces.managed.beans.GoodsBean;

/**
 * Interface for accessing goods in database
 * 
 * @author LukyanyukDV
 * @author SavenkoNV
 */
public interface IGoodsDao {

	/**
	 * Returns GoodsBean by its ID
	 * 
	 * @param category
	 *            selected category
	 * @return GoodsBean by its ID
	 */
	public GoodsBean getGoodsBean(String id);

	/**
	 * Returns goods count of selected subcategory
	 * 
	 * @param category
	 *            selected category
	 * @return
	 */
	public int getGoodsCountForSubcategory(AbstractBean subcategory);

	/**
	 * Returns sorted by sortField column page of goods
	 * 
	 * @param subcategory
	 *            selected subcategory
	 * @param sortField
	 *            column for sorting
	 * @param sortDirection
	 *            ascending or descending sort direction
	 * @param firstRow
	 *            determines first row of current page
	 * @param rowCount
	 *            determines quantity of rows shown in page
	 * @return
	 */
	public List<AbstractBean> getSortedGoodsByPage(AbstractBean subcategory,
			String sortField, String sortDirection, int firstRow, int rowCount);

}